//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS MWAA service.
///
/// Amazon Managed Workflows for Apache Airflow This section contains the Amazon Managed Workflows for Apache Airflow (MWAA) API reference documentation. For more information, see What is Amazon MWAA?.  Endpoints     api.airflow.{region}.amazonaws.com - This endpoint is used for environment management.    CreateEnvironment     DeleteEnvironment     GetEnvironment     ListEnvironments     ListTagsForResource     TagResource     UntagResource     UpdateEnvironment       env.airflow.{region}.amazonaws.com - This endpoint is used to operate the Airflow environment.    CreateCliToken     CreateWebLoginToken     InvokeRestApi       Regions  For a list of supported regions, see Amazon MWAA endpoints and quotas in the Amazon Web Services General Reference.
public struct MWAA: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the MWAA client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "MWAA",
            serviceIdentifier: "airflow",
            serviceProtocol: .restjson,
            apiVersion: "2020-07-01",
            endpoint: endpoint,
            errorType: MWAAErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Creates a CLI token for the Airflow CLI. To learn more, see Creating an Apache Airflow CLI token.
    @Sendable
    @inlinable
    public func createCliToken(_ input: CreateCliTokenRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCliTokenResponse {
        try await self.client.execute(
            operation: "CreateCliToken", 
            path: "/clitoken/{Name}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "env.", 
            logger: logger
        )
    }
    /// Creates a CLI token for the Airflow CLI. To learn more, see Creating an Apache Airflow CLI token.
    ///
    /// Parameters:
    ///   - name: The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.
    ///   - logger: Logger use during operation
    @inlinable
    public func createCliToken(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCliTokenResponse {
        let input = CreateCliTokenRequest(
            name: name
        )
        return try await self.createCliToken(input, logger: logger)
    }

    /// Creates an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment.
    @Sendable
    @inlinable
    public func createEnvironment(_ input: CreateEnvironmentInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateEnvironmentOutput {
        try await self.client.execute(
            operation: "CreateEnvironment", 
            path: "/environments/{Name}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "api.", 
            logger: logger
        )
    }
    /// Creates an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment.
    ///
    /// Parameters:
    ///   - airflowConfigurationOptions: A list of key-value pairs containing the Apache Airflow configuration options you want to attach to your environment. For more information, see Apache Airflow configuration options.
    ///   - airflowVersion: The Apache Airflow version for your environment. If no value is specified, it defaults to the latest version. For more information, see Apache Airflow versions on Amazon Managed Workflows for Apache Airflow (Amazon MWAA). Valid values: 1.10.12, 2.0.2, 2.2.2, 2.4.3, 2.5.1, 2.6.3, 2.7.2, 2.8.1, 2.9.2, 2.10.1, and 2.10.3.
    ///   - dagS3Path: The relative path to the DAGs folder on your Amazon S3 bucket. For example, dags. For more information, see Adding or updating DAGs.
    ///   - endpointManagement: Defines whether the VPC endpoints configured for the environment are created, and managed, by the customer or by Amazon MWAA. If set to SERVICE, Amazon MWAA will create and manage the required VPC endpoints in your VPC. If set to CUSTOMER, you must create, and manage, the VPC endpoints for your VPC. If you choose to create an environment in a shared VPC, you must set this value to CUSTOMER. In a shared VPC deployment, the environment will remain in PENDING status until you create the VPC endpoints. If you do not take action to create the endpoints within 72 hours, the status will change to CREATE_FAILED. You can delete the failed environment and create a new one.
    ///   - environmentClass: The environment class type. Valid values: mw1.micro, mw1.small, mw1.medium, mw1.large, mw1.xlarge, and mw1.2xlarge. For more information, see Amazon MWAA environment class.
    ///   - executionRoleArn: The Amazon Resource Name (ARN) of the execution role for your environment. An execution role is an Amazon Web Services Identity and Access Management (IAM) role that grants MWAA permission to access Amazon Web Services services and resources used by your environment. For example, arn:aws:iam::123456789:role/my-execution-role. For more information, see Amazon MWAA Execution role.
    ///   - kmsKey: The Amazon Web Services Key Management Service (KMS) key to encrypt the data in your environment. You can use an Amazon Web Services owned CMK, or a Customer managed CMK (advanced). For more information, see Create an Amazon MWAA environment.
    ///   - loggingConfiguration: Defines the Apache Airflow logs to send to CloudWatch Logs.
    ///   - maxWebservers:  The maximum number of web servers that you want to run in your environment. Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for MaxWebservers when you interact with your Apache Airflow environment using Apache Airflow REST API, or the Apache Airflow CLI. For example, in scenarios where your workload requires network calls to the Apache Airflow REST API with a high transaction-per-second (TPS) rate, Amazon MWAA will increase the number of web servers up to the number set in MaxWebserers. As TPS rates decrease Amazon MWAA disposes of the additional web servers, and scales down to the number set in MinxWebserers.  Valid values: For environments larger than mw1.micro, accepts values from 2 to 5. Defaults to 2 for all environment sizes except mw1.micro, which defaults to 1.
    ///   - maxWorkers: The maximum number of workers that you want to run in your environment. MWAA scales the number of Apache Airflow workers up to the number you specify in the MaxWorkers field. For example, 20. When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the one worker that is included with your environment, or the number you specify in MinWorkers.
    ///   - minWebservers:  The minimum number of web servers that you want to run in your environment. Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for MaxWebservers when you interact with your Apache Airflow environment using Apache Airflow REST API, or the Apache Airflow CLI. As the transaction-per-second rate, and the network load, decrease, Amazon MWAA disposes of the additional web servers, and scales down to the number set in MinxWebserers.  Valid values: For environments larger than mw1.micro, accepts values from 2 to 5. Defaults to 2 for all environment sizes except mw1.micro, which defaults to 1.
    ///   - minWorkers: The minimum number of workers that you want to run in your environment. MWAA scales the number of Apache Airflow workers up to the number you specify in the MaxWorkers field. When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the worker count you specify in the MinWorkers field. For example, 2.
    ///   - name: The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.
    ///   - networkConfiguration: The VPC networking components used to secure and enable network traffic between the Amazon Web Services resources for your environment. For more information, see About networking on Amazon MWAA.
    ///   - pluginsS3ObjectVersion: The version of the plugins.zip file on your Amazon S3 bucket. You must specify a version each time a plugins.zip file is updated. For more information, see How S3 Versioning works.
    ///   - pluginsS3Path: The relative path to the plugins.zip file on your Amazon S3 bucket. For example, plugins.zip. If specified, then the plugins.zip version is required. For more information, see Installing custom plugins.
    ///   - requirementsS3ObjectVersion: The version of the requirements.txt file on your Amazon S3 bucket. You must specify a version each time a requirements.txt file is updated. For more information, see How S3 Versioning works.
    ///   - requirementsS3Path: The relative path to the requirements.txt file on your Amazon S3 bucket. For example, requirements.txt. If specified, then a version is required. For more information, see Installing Python dependencies.
    ///   - schedulers: The number of Apache Airflow schedulers to run in your environment. Valid values:   v2 - For environments larger than mw1.micro, accepts values from 2 to 5. Defaults to 2 for all environment sizes except mw1.micro, which defaults to 1.   v1 - Accepts 1.
    ///   - sourceBucketArn: The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored. For example, arn:aws:s3:::my-airflow-bucket-unique-name. For more information, see Create an Amazon S3 bucket for Amazon MWAA.
    ///   - startupScriptS3ObjectVersion: The version of the startup shell script in your Amazon S3 bucket. You must specify the version ID that Amazon S3 assigns to the file every time you update the script.   Version IDs are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than 1,024 bytes long. The following is an example:   3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo   For more information, see Using a startup script.
    ///   - startupScriptS3Path: The relative path to the startup shell script in your Amazon S3 bucket. For example, s3://mwaa-environment/startup.sh.  Amazon MWAA runs the script as your environment starts, and before running the Apache Airflow process. You can use this script to install dependencies, modify Apache Airflow configuration options, and set environment variables. For more information, see Using a startup script.
    ///   - tags: The key-value tag pairs you want to associate to your environment. For example, "Environment": "Staging". For more information, see Tagging Amazon Web Services resources.
    ///   - webserverAccessMode: Defines the access mode for the Apache Airflow web server. For more information, see Apache Airflow access modes.
    ///   - weeklyMaintenanceWindowStart: The day and time of the week in Coordinated Universal Time (UTC) 24-hour standard time to start weekly maintenance updates of your environment in the following format: DAY:HH:MM. For example: TUE:03:30. You can specify a start time in 30 minute increments only.
    ///   - logger: Logger use during operation
    @inlinable
    public func createEnvironment(
        airflowConfigurationOptions: [String: String]? = nil,
        airflowVersion: String? = nil,
        dagS3Path: String,
        endpointManagement: EndpointManagement? = nil,
        environmentClass: String? = nil,
        executionRoleArn: String,
        kmsKey: String? = nil,
        loggingConfiguration: LoggingConfigurationInput? = nil,
        maxWebservers: Int? = nil,
        maxWorkers: Int? = nil,
        minWebservers: Int? = nil,
        minWorkers: Int? = nil,
        name: String,
        networkConfiguration: NetworkConfiguration,
        pluginsS3ObjectVersion: String? = nil,
        pluginsS3Path: String? = nil,
        requirementsS3ObjectVersion: String? = nil,
        requirementsS3Path: String? = nil,
        schedulers: Int? = nil,
        sourceBucketArn: String,
        startupScriptS3ObjectVersion: String? = nil,
        startupScriptS3Path: String? = nil,
        tags: [String: String]? = nil,
        webserverAccessMode: WebserverAccessMode? = nil,
        weeklyMaintenanceWindowStart: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateEnvironmentOutput {
        let input = CreateEnvironmentInput(
            airflowConfigurationOptions: airflowConfigurationOptions, 
            airflowVersion: airflowVersion, 
            dagS3Path: dagS3Path, 
            endpointManagement: endpointManagement, 
            environmentClass: environmentClass, 
            executionRoleArn: executionRoleArn, 
            kmsKey: kmsKey, 
            loggingConfiguration: loggingConfiguration, 
            maxWebservers: maxWebservers, 
            maxWorkers: maxWorkers, 
            minWebservers: minWebservers, 
            minWorkers: minWorkers, 
            name: name, 
            networkConfiguration: networkConfiguration, 
            pluginsS3ObjectVersion: pluginsS3ObjectVersion, 
            pluginsS3Path: pluginsS3Path, 
            requirementsS3ObjectVersion: requirementsS3ObjectVersion, 
            requirementsS3Path: requirementsS3Path, 
            schedulers: schedulers, 
            sourceBucketArn: sourceBucketArn, 
            startupScriptS3ObjectVersion: startupScriptS3ObjectVersion, 
            startupScriptS3Path: startupScriptS3Path, 
            tags: tags, 
            webserverAccessMode: webserverAccessMode, 
            weeklyMaintenanceWindowStart: weeklyMaintenanceWindowStart
        )
        return try await self.createEnvironment(input, logger: logger)
    }

    /// Creates a web login token for the Airflow Web UI. To learn more, see Creating an Apache Airflow web login token.
    @Sendable
    @inlinable
    public func createWebLoginToken(_ input: CreateWebLoginTokenRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateWebLoginTokenResponse {
        try await self.client.execute(
            operation: "CreateWebLoginToken", 
            path: "/webtoken/{Name}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "env.", 
            logger: logger
        )
    }
    /// Creates a web login token for the Airflow Web UI. To learn more, see Creating an Apache Airflow web login token.
    ///
    /// Parameters:
    ///   - name: The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.
    ///   - logger: Logger use during operation
    @inlinable
    public func createWebLoginToken(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateWebLoginTokenResponse {
        let input = CreateWebLoginTokenRequest(
            name: name
        )
        return try await self.createWebLoginToken(input, logger: logger)
    }

    /// Deletes an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment.
    @Sendable
    @inlinable
    public func deleteEnvironment(_ input: DeleteEnvironmentInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteEnvironmentOutput {
        try await self.client.execute(
            operation: "DeleteEnvironment", 
            path: "/environments/{Name}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "api.", 
            logger: logger
        )
    }
    /// Deletes an Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment.
    ///
    /// Parameters:
    ///   - name: The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteEnvironment(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteEnvironmentOutput {
        let input = DeleteEnvironmentInput(
            name: name
        )
        return try await self.deleteEnvironment(input, logger: logger)
    }

    /// Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.
    @Sendable
    @inlinable
    public func getEnvironment(_ input: GetEnvironmentInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetEnvironmentOutput {
        try await self.client.execute(
            operation: "GetEnvironment", 
            path: "/environments/{Name}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "api.", 
            logger: logger
        )
    }
    /// Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.
    ///
    /// Parameters:
    ///   - name: The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.
    ///   - logger: Logger use during operation
    @inlinable
    public func getEnvironment(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetEnvironmentOutput {
        let input = GetEnvironmentInput(
            name: name
        )
        return try await self.getEnvironment(input, logger: logger)
    }

    /// Invokes the Apache Airflow REST API on the webserver with the specified inputs. To learn more, see Using the Apache Airflow REST API
    @Sendable
    @inlinable
    public func invokeRestApi(_ input: InvokeRestApiRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> InvokeRestApiResponse {
        try await self.client.execute(
            operation: "InvokeRestApi", 
            path: "/restapi/{Name}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "env.", 
            logger: logger
        )
    }
    /// Invokes the Apache Airflow REST API on the webserver with the specified inputs. To learn more, see Using the Apache Airflow REST API
    ///
    /// Parameters:
    ///   - body: The request body for the Apache Airflow REST API call, provided as a JSON object.
    ///   - method: The HTTP method used for making Airflow REST API calls. For example, POST.
    ///   - name: The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.
    ///   - path: The Apache Airflow REST API endpoint path to be called. For example, /dags/123456/clearTaskInstances. For more information, see Apache Airflow API
    ///   - queryParameters: Query parameters to be included in the Apache Airflow REST API call, provided as a JSON object.
    ///   - logger: Logger use during operation
    @inlinable
    public func invokeRestApi(
        body: AWSDocument? = nil,
        method: RestApiMethod,
        name: String,
        path: String,
        queryParameters: AWSDocument? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> InvokeRestApiResponse {
        let input = InvokeRestApiRequest(
            body: body, 
            method: method, 
            name: name, 
            path: path, 
            queryParameters: queryParameters
        )
        return try await self.invokeRestApi(input, logger: logger)
    }

    /// Lists the Amazon Managed Workflows for Apache Airflow (MWAA) environments.
    @Sendable
    @inlinable
    public func listEnvironments(_ input: ListEnvironmentsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListEnvironmentsOutput {
        try await self.client.execute(
            operation: "ListEnvironments", 
            path: "/environments", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "api.", 
            logger: logger
        )
    }
    /// Lists the Amazon Managed Workflows for Apache Airflow (MWAA) environments.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to retrieve per page. For example, 5 environments per page.
    ///   - nextToken: Retrieves the next page of the results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listEnvironments(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListEnvironmentsOutput {
        let input = ListEnvironmentsInput(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listEnvironments(input, logger: logger)
    }

    /// Lists the key-value tag pairs associated to the Amazon Managed Workflows for Apache Airflow (MWAA) environment. For example, "Environment": "Staging".
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceOutput {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "api.", 
            logger: logger
        )
    }
    /// Lists the key-value tag pairs associated to the Amazon Managed Workflows for Apache Airflow (MWAA) environment. For example, "Environment": "Staging".
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceOutput {
        let input = ListTagsForResourceInput(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    ///  Internal only. Publishes environment health metrics to Amazon CloudWatch.
    @available(*, deprecated, message: "This API is for internal use and not meant for public use, and is no longer available.")
    @Sendable
    @inlinable
    public func publishMetrics(_ input: PublishMetricsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> PublishMetricsOutput {
        try await self.client.execute(
            operation: "PublishMetrics", 
            path: "/metrics/environments/{EnvironmentName}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "ops.", 
            logger: logger
        )
    }
    ///  Internal only. Publishes environment health metrics to Amazon CloudWatch.
    ///
    /// Parameters:
    ///   - environmentName:  Internal only. The name of the environment.
    ///   - metricData:  Internal only. Publishes metrics to Amazon CloudWatch. To learn more about the metrics published to Amazon CloudWatch, see Amazon MWAA performance metrics in Amazon CloudWatch.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This API is for internal use and not meant for public use, and is no longer available.")
    @inlinable
    public func publishMetrics(
        environmentName: String,
        metricData: [MetricDatum],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PublishMetricsOutput {
        let input = PublishMetricsInput(
            environmentName: environmentName, 
            metricData: metricData
        )
        return try await self.publishMetrics(input, logger: logger)
    }

    /// Associates key-value tag pairs to your Amazon Managed Workflows for Apache Airflow (MWAA) environment.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceOutput {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "api.", 
            logger: logger
        )
    }
    /// Associates key-value tag pairs to your Amazon Managed Workflows for Apache Airflow (MWAA) environment.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment.
    ///   - tags: The key-value tag pairs you want to associate to your environment. For example, "Environment": "Staging". For more information, see Tagging Amazon Web Services resources.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceOutput {
        let input = TagResourceInput(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes key-value tag pairs associated to your Amazon Managed Workflows for Apache Airflow (MWAA) environment. For example, "Environment": "Staging".
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceOutput {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "api.", 
            logger: logger
        )
    }
    /// Removes key-value tag pairs associated to your Amazon Managed Workflows for Apache Airflow (MWAA) environment. For example, "Environment": "Staging".
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment.
    ///   - tagKeys: The key-value tag pair you want to remove. For example, "Environment": "Staging".
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceOutput {
        let input = UntagResourceInput(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates an Amazon Managed Workflows for Apache Airflow (MWAA) environment.
    @Sendable
    @inlinable
    public func updateEnvironment(_ input: UpdateEnvironmentInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateEnvironmentOutput {
        try await self.client.execute(
            operation: "UpdateEnvironment", 
            path: "/environments/{Name}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "api.", 
            logger: logger
        )
    }
    /// Updates an Amazon Managed Workflows for Apache Airflow (MWAA) environment.
    ///
    /// Parameters:
    ///   - airflowConfigurationOptions: A list of key-value pairs containing the Apache Airflow configuration options you want to attach to your environment. For more information, see Apache Airflow configuration options.
    ///   - airflowVersion: The Apache Airflow version for your environment. To upgrade your environment, specify a newer version of Apache Airflow supported by Amazon MWAA. Before you upgrade an environment, make sure your requirements, DAGs, plugins, and other resources used in your workflows are compatible with the new Apache Airflow version. For more information about updating your resources, see Upgrading an Amazon MWAA environment. Valid values: 1.10.12, 2.0.2, 2.2.2, 2.4.3, 2.5.1, 2.6.3, 2.7.2, 2.8.1, 2.9.2, 2.10.1, and 2.10.3.
    ///   - dagS3Path: The relative path to the DAGs folder on your Amazon S3 bucket. For example, dags. For more information, see Adding or updating DAGs.
    ///   - environmentClass: The environment class type. Valid values: mw1.micro, mw1.small, mw1.medium, mw1.large, mw1.xlarge, and mw1.2xlarge. For more information, see Amazon MWAA environment class.
    ///   - executionRoleArn: The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access Amazon Web Services resources in your environment. For example, arn:aws:iam::123456789:role/my-execution-role. For more information, see Amazon MWAA Execution role.
    ///   - loggingConfiguration: The Apache Airflow log types to send to CloudWatch Logs.
    ///   - maxWebservers:  The maximum number of web servers that you want to run in your environment. Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for MaxWebservers when you interact with your Apache Airflow environment using Apache Airflow REST API, or the Apache Airflow CLI. For example, in scenarios where your workload requires network calls to the Apache Airflow REST API with a high transaction-per-second (TPS) rate, Amazon MWAA will increase the number of web servers up to the number set in MaxWebserers. As TPS rates decrease Amazon MWAA disposes of the additional web servers, and scales down to the number set in MinxWebserers.  Valid values: For environments larger than mw1.micro, accepts values from 2 to 5. Defaults to 2 for all environment sizes except mw1.micro, which defaults to 1.
    ///   - maxWorkers: The maximum number of workers that you want to run in your environment. MWAA scales the number of Apache Airflow workers up to the number you specify in the MaxWorkers field. For example, 20. When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the one worker that is included with your environment, or the number you specify in MinWorkers.
    ///   - minWebservers:  The minimum number of web servers that you want to run in your environment. Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for MaxWebservers when you interact with your Apache Airflow environment using Apache Airflow REST API, or the Apache Airflow CLI. As the transaction-per-second rate, and the network load, decrease, Amazon MWAA disposes of the additional web servers, and scales down to the number set in MinxWebserers.  Valid values: For environments larger than mw1.micro, accepts values from 2 to 5. Defaults to 2 for all environment sizes except mw1.micro, which defaults to 1.
    ///   - minWorkers: The minimum number of workers that you want to run in your environment. MWAA scales the number of Apache Airflow workers up to the number you specify in the MaxWorkers field. When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the worker count you specify in the MinWorkers field. For example, 2.
    ///   - name: The name of your Amazon MWAA environment. For example, MyMWAAEnvironment.
    ///   - networkConfiguration: The VPC networking components used to secure and enable network traffic between the Amazon Web Services resources for your environment. For more information, see About networking on Amazon MWAA.
    ///   - pluginsS3ObjectVersion: The version of the plugins.zip file on your Amazon S3 bucket. You must specify a version each time a plugins.zip file is updated. For more information, see How S3 Versioning works.
    ///   - pluginsS3Path: The relative path to the plugins.zip file on your Amazon S3 bucket. For example, plugins.zip. If specified, then the plugins.zip version is required. For more information, see Installing custom plugins.
    ///   - requirementsS3ObjectVersion: The version of the requirements.txt file on your Amazon S3 bucket. You must specify a version each time a requirements.txt file is updated. For more information, see How S3 Versioning works.
    ///   - requirementsS3Path: The relative path to the requirements.txt file on your Amazon S3 bucket. For example, requirements.txt. If specified, then a file version is required. For more information, see Installing Python dependencies.
    ///   - schedulers: The number of Apache Airflow schedulers to run in your Amazon MWAA environment.
    ///   - sourceBucketArn: The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored. For example, arn:aws:s3:::my-airflow-bucket-unique-name. For more information, see Create an Amazon S3 bucket for Amazon MWAA.
    ///   - startupScriptS3ObjectVersion:  The version of the startup shell script in your Amazon S3 bucket. You must specify the version ID that Amazon S3 assigns to the file every time you update the script.   Version IDs are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than 1,024 bytes long. The following is an example:   3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo   For more information, see Using a startup script.
    ///   - startupScriptS3Path: The relative path to the startup shell script in your Amazon S3 bucket. For example, s3://mwaa-environment/startup.sh.  Amazon MWAA runs the script as your environment starts, and before running the Apache Airflow process. You can use this script to install dependencies, modify Apache Airflow configuration options, and set environment variables. For more information, see Using a startup script.
    ///   - webserverAccessMode: The Apache Airflow Web server access mode. For more information, see Apache Airflow access modes.
    ///   - weeklyMaintenanceWindowStart: The day and time of the week in Coordinated Universal Time (UTC) 24-hour standard time to start weekly maintenance updates of your environment in the following format: DAY:HH:MM. For example: TUE:03:30. You can specify a start time in 30 minute increments only.
    ///   - workerReplacementStrategy: The worker replacement strategy to use when updating the environment. You can select one of the following strategies:    Forced - Stops and replaces Apache Airflow workers without waiting for tasks to  complete before an update.    Graceful - Allows Apache Airflow workers to complete running tasks for up to 12 hours during an update before  they're stopped and replaced.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateEnvironment(
        airflowConfigurationOptions: [String: String]? = nil,
        airflowVersion: String? = nil,
        dagS3Path: String? = nil,
        environmentClass: String? = nil,
        executionRoleArn: String? = nil,
        loggingConfiguration: LoggingConfigurationInput? = nil,
        maxWebservers: Int? = nil,
        maxWorkers: Int? = nil,
        minWebservers: Int? = nil,
        minWorkers: Int? = nil,
        name: String,
        networkConfiguration: UpdateNetworkConfigurationInput? = nil,
        pluginsS3ObjectVersion: String? = nil,
        pluginsS3Path: String? = nil,
        requirementsS3ObjectVersion: String? = nil,
        requirementsS3Path: String? = nil,
        schedulers: Int? = nil,
        sourceBucketArn: String? = nil,
        startupScriptS3ObjectVersion: String? = nil,
        startupScriptS3Path: String? = nil,
        webserverAccessMode: WebserverAccessMode? = nil,
        weeklyMaintenanceWindowStart: String? = nil,
        workerReplacementStrategy: WorkerReplacementStrategy? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateEnvironmentOutput {
        let input = UpdateEnvironmentInput(
            airflowConfigurationOptions: airflowConfigurationOptions, 
            airflowVersion: airflowVersion, 
            dagS3Path: dagS3Path, 
            environmentClass: environmentClass, 
            executionRoleArn: executionRoleArn, 
            loggingConfiguration: loggingConfiguration, 
            maxWebservers: maxWebservers, 
            maxWorkers: maxWorkers, 
            minWebservers: minWebservers, 
            minWorkers: minWorkers, 
            name: name, 
            networkConfiguration: networkConfiguration, 
            pluginsS3ObjectVersion: pluginsS3ObjectVersion, 
            pluginsS3Path: pluginsS3Path, 
            requirementsS3ObjectVersion: requirementsS3ObjectVersion, 
            requirementsS3Path: requirementsS3Path, 
            schedulers: schedulers, 
            sourceBucketArn: sourceBucketArn, 
            startupScriptS3ObjectVersion: startupScriptS3ObjectVersion, 
            startupScriptS3Path: startupScriptS3Path, 
            webserverAccessMode: webserverAccessMode, 
            weeklyMaintenanceWindowStart: weeklyMaintenanceWindowStart, 
            workerReplacementStrategy: workerReplacementStrategy
        )
        return try await self.updateEnvironment(input, logger: logger)
    }
}

extension MWAA {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: MWAA, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MWAA {
    /// Return PaginatorSequence for operation ``listEnvironments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listEnvironmentsPaginator(
        _ input: ListEnvironmentsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListEnvironmentsInput, ListEnvironmentsOutput> {
        return .init(
            input: input,
            command: self.listEnvironments,
            inputKey: \ListEnvironmentsInput.nextToken,
            outputKey: \ListEnvironmentsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listEnvironments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to retrieve per page. For example, 5 environments per page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listEnvironmentsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListEnvironmentsInput, ListEnvironmentsOutput> {
        let input = ListEnvironmentsInput(
            maxResults: maxResults
        )
        return self.listEnvironmentsPaginator(input, logger: logger)
    }
}

extension MWAA.ListEnvironmentsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MWAA.ListEnvironmentsInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
